#pragma once
#include "socketclient.h"
#define APP_NAME "NT"
#define APP_VERSION "20130713"
#define APP_OPTION	"p:g:o:v"

class MyShell
{
public:
	MyShell();
	void ShowHelp();
	void ShowVersion();
	bool ProcCmdOpen(const char* szIp,WORD wPort=5082);
	void SetServer(const char* szIp,WORD wPort=5082);
	int ProcCmdPut(const char* szLocalFileName);
	//int ProcCmdRl();
	bool ProcCmdGet(const char* pszRemotePath,const char* pszLocalPath);
	bool ProcGetFile(const FILE_INFO* pFileInfo,const char* pszLocalPath);
	bool SendRequest(int nCmd, void* pData =NULL , DWORD dwDataLen =0 );
	bool GetResponse(PACK_RESPONSE* pResponse, void* pData=NULL, DWORD dwDataLen=0);
	bool SendLocalFile(const char* szFileName, DWORD dwFileLength);
	bool RecvRemoteFile(const FILE_INFO* pFileInfo,const char* pszSaveFileName);
	bool IsConnected();

public:
	bool PathIsDir(const char* pszPath,string& strRealPath);
	
public:
	SocketClient m_sock;
	WORD m_wProt;
	char m_szIp[16];
	char m_szLastLocalPath[PATH_MAX];
};